import { useRequest } from "../../../../utils/request";

Component({
    properties: {},
    data: {
        value: '',
        success: false
    },
    methods: {
        onLoad() {
            this.request = new useRequest('api/userwallettotal', {
                data: 'data',
                hold: true
            }, this)

            this.takeRequest = new useRequest('api/applywithdrawal', {
                hold: true
            }, this)
        },

        onShow() {
            this.request.run()
        },

        submit() {
            this.takeRequest.run({
                type: 1,
                total: this.data.value
            }).then(() => {
                this.setData({
                    success: true
                })
            })
        },

        back() {
            wx.navigateBack()
        }
    }
});
